Method and system for unsynchronized structured lighting

ABSTRACT

A system and method to capture the surface geometry a three-dimensional object in a scene using unsynchronized structured lighting is disclosed. The method and system includes a pattern projector configured and arranged to project a sequence of image patterns onto the scene at a pattern frame rate, a camera configured and arranged to capture a sequence of unsynchronized image patterns of the scene at an image capture rate, and a processor configured and arranged to synthesize a sequence of synchronized image frames from the unsynchronized image patterns of the scene. Each of the synchronized image frames corresponds to one image pattern of the sequence of image patterns.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation application of U.S. patent application Ser. No. 16/434,846 filed Jun. 7, 2019, which is a divisional application of U.S. patent application Ser. No. 15/124,176 filed Sep. 7, 2016, which is a national phase filing under 35 U.S.C. § 371 of International Application No. PCT/US2015/019357 filed Mar. 9, 2015, which claims priority to earlier filed U.S. Provisional Application Ser. No. 61/949,529 filed Mar. 7, 2014, the entire contents of which are incorporated herein by reference.

STATEMENT REGARDING GOVERNMENT INTEREST

This Invention was made with government support under grant number DE-FG02-08ER15937 awarded by the Department of Energy. The government has certain rights in the invention.

BACKGROUND OF THE INVENTION 1. Field of the Invention

This patent document relates generally to the field of three-dimensional shape capture of the surface geometry of an object, and more particularly to structured lighting three-dimensional shape capture.

2. Background of the Related Art

Three-dimensional scanning and digitization of the surface geometry of objects is commonly used in many industries and services, and their applications are numerous. A few examples of such applications are inspection and measurement of shape conformity in industrial production systems, digitization of clay models for industrial design and styling applications, reverse engineering of existing parts with complex geometry for three-dimensional printing, interactive visualization of objects in multimedia applications, three-dimensional documentation of artwork, historic and archaeological artifacts, human body scanning for better orthotics adaptation, biometry or custom-fit clothing, and three-dimensional forensic reconstruction of crime scenes.

One technology for three-dimensional shape capture is based on structured lighting. Three dimensional shape capture systems based on structure lighting are more accurate than those based on time-of-flight (TOF) image sensors. In a standard structured lighting 3D shape capture system a pattern projector is used to illuminate the scene of interest with a sequence of known two-dimensional patterns, and a camera is used to capture a sequence of images, synchronized with the projected patterns. The camera captures one image for each projected pattern. Each sequence of images captured by the camera is decoded by a computer processor into a dense set of projector-camera pixel correspondences, and subsequently into a three-dimensional range image, using the principles of optical triangulation.

The main limitation of three-dimensional shape capture systems is the required synchronization between projector and camera. To capture a three-dimensional snapshot of a moving scene, the sequence of patterns must be projected at a fast rate, the camera must capture image frames exactly at the same frame rate, and the camera has to start capturing the first frame of the sequence exactly when the projector starts to project the first pattern.

Therefore, there is a need for three-dimensional shape measurement methods and systems based on structure lighting where the camera and the pattern projector are not synchronized.

Further complicating matters, image sensors generally use one of two different technologies to capture an image, referred to as “rolling shutter” and “global shutter”. “Rolling shutter” is a method of image capture in which a still picture or each frame of a video is captured not by taking a snapshot of the entire scene at single instant in time but rather by scanning across the scene rapidly, either vertically or horizontally. In other words, not all parts of the image of the scene are recorded at exactly the same instant. This is in contrast with “global shutter” in which the entire frame is captured at the same instant. Even though most image sensors in consumer devices are rolling shutter sensors, many image sensors used in industrial applications are global shutter sensors.

Therefore, there is a need for three-dimensional shape measurement methods and systems based on structure lighting where the camera and the pattern projector are not synchronized, supporting both global shutter and rolling shutter image sensors.

SUMMARY OF THE INVENTION

A system and method to capture the surface geometry a three-dimensional object in a scene using unsynchronized structured lighting solves the problems of the prior art. The method and system includes a pattern projector configured and arranged to project a sequence of image patterns onto the scene at a pattern frame rate, a camera configured and arranged to capture a sequence of unsynchronized image patterns of the scene at an image capture rate; and a processor configured and arranged to synthesize a sequence of synchronized image frames from the unsynchronized image patterns of the scene, each of the synchronized image frames corresponding to one image pattern of the sequence of image patterns. Because the method enables use of an unsynchronized pattern projector and camera significant cost savings can be achieved. The method enables use of inexpensive cameras, such as smartphone cameras, webcams, point-and-shoot digital cameras, camcorders as well as industrial cameras. Furthermore, the method and system enable processing the images with a variety of computing hardware, such as computers, digital signal processors, smartphone processors and the like. Consequently, three-dimensional image capture using structured lighting may be used with relatively little capital investment.

BRIEF DESCRIPTION OF THE DRAWINGS

These and other features, aspects, and advantages of the method and system will become better understood with reference to the following description, appended claims, and accompanying drawings where:

FIG. 1 is an illustration of an exemplary embodiment of the method and system for unsynchronized structured lighting;

FIG. 2 shows a flowchart of an exemplary embodiment of the method and system for unsynchronized structured lighting;

FIG. 3 shows a flowchart of an exemplary embodiment of the method and system for unsynchronized structured lighting of synthesizing the synchronized sequence of image frames;

FIG. 4 is a chart illustrating the timing for a method to synthesize the synchronized sequence of image frames from an unsynchronized sequence of image frames, where a global shutter image sensor is used and where the image frame rate is identical to the pattern frame rate;

FIG. 5 is a chart illustrating the timing for a method to synthesize the synchronized sequence of image frames from an unsynchronized sequence of image frames, where a rolling shutter image sensor is used and where the image frame rate is identical to the pattern frame rate;

FIG. 6 is a chart illustrating the timing for a method to synthesize the synchronized sequence of image frames from an unsynchronized sequence of image frames, where a global shutter image sensor is used and where the image frame rate is higher or equal than the pattern frame rate

FIG. 7 is a chart illustrating the timing for method to synthesize the synchronized sequence of image frames from an unsynchronized sequence of image frames, where a rolling shutter image sensor is used and where the image frame rate is higher or equal than the pattern frame rate;

FIG. 8 shows a chart illustrating a calibration pattern used to correct the time;

FIG. 9 shows a chart illustrating image data normalized according to the method described herein; and

FIG. 10 shows a chart illustrating a model estimating the pattern value for each pixel in a captured image.

DETAILED DESCRIPTION

A system and method to capture the surface geometry a three-dimensional object in a scene using unsynchronized structured lighting is shown generally in FIGS. 1 and 2. The method and system includes a pattern projector configured and arranged to project a sequence of image patterns onto the scene at a pattern frame rate, a camera configured and arranged to capture a sequence of unsynchronized image patterns of the scene at an image capture rate; and a processor configured and arranged to synthesize a sequence of synchronized image frames from the unsynchronized image patterns of the scene, each of the synchronized image frames corresponding to one image pattern of the sequence of image patterns.

One object of the present invention is a system to synthesize a synchronized sequence of image frames from an unsynchronized sequence of image frames, illustrated in FIG. 1; the unsynchronized image frames captured while a three-dimensional scene was illuminated by a sequence of patterns. The system comprises a pattern projector 2020 and a camera 2030. An object 2010 is partially illuminated by the pattern projector 2020, and partially visible by the camera 2030. The pattern projector projects a sequence of patterns 2021, 2022, 2023 at a certain pattern rate. The pattern rate is measured in patterns per second. The camera 2030 captures a sequence of unsynchronized image frames 2031, 2032, 2033, 2034, at a certain frame rate. The frame rate is larger or equal than the pattern rate. The number of unsynchronized image frames captured by the camera is larger or equal than the number of patterns in the sequence of patterns. The camera starts capturing the first unsynchronized image frame not earlier than the time when the projector starts projecting the first pattern of the sequence of image patterns. The camera ends capturing the last unsynchronized image frame not earlier than the time when the projector ends projecting the last pattern of the sequence of image patterns. To capture a frame the camera opens the camera aperture, which it closes after an exposure time. The camera determines the pixel values by integrating the incoming light while the aperture is open. Since camera and projector are not synchronized, the projector may switch patterns while the camera has the aperture open. As a result, some or all of the pixels of the captured unsynchronized image frame 2032 will be partially exposed to two consecutive patterns 2021 and 2022. The resulting sequence of unsynchronized image frames, are transmitted to a computer processor 2040, which executes a method to synthesize a synchronized sequence of image frames from the unsynchronized sequence of image frames. The number of frames in the synchronized sequence of image frames 2041, 2042, 2043 will be the same as the number of patterns 2021, 2022, 2023 and represent estimates of what the camera would have captured if it were synchronized with the projector. In a preferred embodiment the camera 2030 and the computer processor 2040 are components of a single device such a digital camera, smartphone, or computer tablet.

Another object of the invention is an unsynchronized three-dimensional shape capture system, comprising the system to synthesize a synchronized sequence of image frames from an unsynchronized sequence of image frames described above, and further comprising prior art methods for decoding, three-dimensional triangulation, and optionally geometric processing, executed by the computer processor.

Another object of the invention is a three-dimensional snapshot camera comprising the unsynchronized three-dimensional shape capture system, where the projector has the means to select the pattern rate from a plurality of supported pattern rates, the camera has the means to select the frame rate from a plurality of supported frame rates, and the camera is capable of capturing the unsynchronized image frames in burst mode at a fast frame rate. In a preferred embodiment the projector has a knob to select the pattern rate. In another preferred embodiment the pattern rate is set by a pattern rate code sent to the projector through a communications link. Furthermore, the system has means to set the pattern rate and the frame rate so that the frame rate is not slower than the pattern rate. In a more preferred embodiment the user sets the pattern rate and the frame rate.

In a more preferred embodiment of the snapshot camera, the camera has the means to receive a camera trigger signal, and the means to set the number of burst mode frames. In an even more preferred embodiment, the camera trigger signal is generated by a camera trigger push-button. When the camera receives the trigger signal it starts capturing the unsynchronized image frames at the set frame rate, and it stops capturing unsynchronized image frames after capturing the set number of burst mode frames.

In a first preferred embodiment of the snapshot camera with camera trigger signal, the projector continuously projects the sequence of patterns in a cyclic fashion. In a more preferred embodiment the system has the means of detecting when the first pattern is about to be projected, and the camera trigger signal is delayed until that moment.

In a second preferred embodiment of the snapshot camera with camera trigger signal, the projector has the means to receive a projector trigger signal. In a more preferred embodiment the camera generates the projector trigger signal after receiving the camera trigger signal, and the camera has the means to send the projector trigger signal to the projector. In an even more preferred embodiment the camera has a flash trigger output, and it sends the projector trigger signal to the projector through the flash trigger output. When the projector receives the trigger signal it starts projecting the sequence of patterns at the set pattern rate, and it stops projecting patterns after it projects the last pattern.

Another object of this invention is a method to synthesize a synchronized sequence of image frames from an unsynchronized sequence of image frames, generating a number of frames in the synchronized sequence of image frames equal to the number of projected patterns, and representing estimates of what the camera would have captured if it were synchronized with the projector.

As will be described in greater detail below in the associated proofs, the method to synthesize the synchronized sequence of image frames from the unsynchronized sequence of image frames is shown generally in FIG. 3. Each of the synchronized image frames corresponds to one of a sequence of image patterns. Further, the synchronized image frames and unsynchronized image frames have the same width and height. Each image frame includes a plurality of common pixels. In a first step a) the plurality of common pixels is partitioned into a pixel partition. The pixel partition includes a plurality of pixel sets, each of which is disjoint. Further each of the plurality of common pixels is a member of one of the pixel sets. In a step b) a pixel set is selected. In a step c) a pixel set measurement matrix is built. In a step d) a pixel set projection matrix is estimated. The pixel set projection matrix projects a measurement space vector onto the column space of the pixel set measurement matrix. In a step e) a pixel set system matrix is estimated. The system matrix is parameterized by a set of system matrix parameters. In a step f) a pixel set synchronized matrix as a function of the pixel set measurement matrix and the pixel set system matrix is estimated. In a step g) steps b) to f) are repeated until all the pixels sets have been selected. In a step h) a sequence of synchronized image frames from the pixel set synchronized matrices is constructed.

In a preferred embodiment, the method to synthesize the synchronized sequence of image frames from an unsynchronized sequence of image frames, applies to a global shutter image sensor where the image frame rate is identical to the pattern frame rate. FIG. 4 illustrates the timing for this embodiment. In this embodiment, the projector projects N patterns at a fixed frame rate, a global shutter image sensor capture N images at identical frame rate. Capturing each image takes exactly one unit of time, normalized by the projector frame rate. The start time for the first image capture t.sub.0 is unknown, but the start time for the n-th image capture is related to the start time for the first image capture t_(n)=t₀+n−1. The actual value measured by the image sensor at the (x, y) pixel of the n-th image, can be modeled as I _(n)(x,y)=(1−i ₀)P _(n)(x,y)+i ₀ P _(n+1)(x,y)

where P_(n)(x, y) and P_(n−1)(x, y) represent the pattern values to be estimated that contribute to the image pixel (x, y) and P_(n+1)=P₁. Projected patterns are known in advance, but since it is not known which projector pixel illuminates each image pixel, they have to be treated as unknown. To estimate the value of t.sub.0, the following expression is minimized

${E\left( t_{0} \right)} = {\frac{1}{2}{\sum\limits_{n = 1}^{N}{\sum\limits_{({x,y})}\left( {{\left( {1 - t_{0}} \right){P_{n}\left( {x,y} \right)}} + {t_{0}{P_{n + 1}\left( {x,y} \right)}} - {I_{n}\left( {x,y} \right)}} \right)^{2}}}}$

with respect to t₀, where the sum is over a subset of pixels (x, y) for which the corresponding pattern pixel values P_(n)(x, y) and P_(n−1)(x, y) are known. Differentiating E(t₀) with respect to t₀ and equating the result to zero, an expression to estimate t₀ is obtained

$t_{0} = \frac{\sum\limits_{n = 1}^{N}{\sum\limits_{({x,y})}{\left( {{P_{n + 1}\left( {x,y} \right)} - {P_{n}\left( {x,y} \right)}} \right)\left( {{I_{n}\left( {x,y} \right)} - {P_{n}\left( {x,y} \right)}} \right)}}}{\sum\limits_{n = 1}^{N}{\sum\limits_{({x,y})}\left( {{P_{n + 1}\left( {x,y} \right)} - {P_{n}\left( {x,y} \right)}} \right)^{2}}}$

Once the value of t₀ has been estimated, the N pattern pixel values P₁(x, y), . . . , P_(n)(x, y) can be estimated for each pixel (x, y) by minimizing the following expression E(P ₁(x,y), . . . ,P _(N)(x,y))=½Σ_(n=1) ^(N)((1−t ₀)P _(n)(x,y)+t ₀ P _(n+1)(x,y)−I _(n)(x,y))²

which reduces to solving the following system of N linear equations βP _(n−1)(x,y)+αP _(n)(x,y)+βP _(n+1)(x,y)=t ₀ I _(n−1)(x,y)+(1−t ₀)I _(n)(x,y)

for n=1, . . . , N, where α=t² ₀+(1−t₀)² and β=t₀(1−t₀).

In another preferred embodiment, the method to synthesize the synchronized sequence of image frames from an unsynchronized sequence of image frames, applies to a rolling shutter image sensor where the image frame rate is identical to the pattern frame rate. FIG. 5 illustrates the timing for this embodiment. We project N patterns at fixed framerate, a rolling shutter camera captures N images. Capture begins while pattern P₁ is being projected. Projector framerate is 1, pattern P_(n) is projected between time n−1 and n. A camera frame is read every t_(f) time, camera framerate is assumed equal to projector framerate but in practice may vary a little. A camera row requires t_(r) time to be readout from the sensor, thus, a sensor with Y rows needs a time Yt_(r) to read a complete frame, Yt_(f) less than or equal to t_(r). Each camera frame is exposed t.sub.e time, its readout begins immediately after exposure ends, t_(e)+t_(f) less than or equal to t_(f).

Camera row y in image n begins being exposed at time t_(n,y) t _(n,y) =t ₀+(n−1)t _(f) +yt _(r) ,y:0 . . . Y−1,

and exposition ends at time t_(n,y)+t_(e)

In this model image n is exposed while pattern P_(n) and P_(n+1) are being projected. Intensity level measured at a pixel in row y is given by I _(n,y)=(n−t _(n,y))k _(n,y) P _(n)+(t _(n,y) +t _(e) −n)k _(n,y) P _(n+1) +C _(n,y),

The constants k_(n, y) and C_(n, y) are scene dependent.

Let be min {I_(n, y)} a pixel being exposed while P(t)=0, and max {I_(n,y)} a pixel being exposed while P(t)=1, max {I_(n, y)}=t_(e) k_(n, y)+C_(n, y). Now, we define a normalized image I_(n, y) as,

${\overset{\sim}{I}}_{n,y} = \frac{{\left( {n - t_{n,y}} \right)P_{n}} + {\left( {{t_{n,y}t_{e}} - n} \right)P_{n + 1}}}{t_{e}}$

A normalized image is completely defined by the time variables and pattern values. In this section we want to estimate the time variables. Lets rewrite Equation 58 as

${\overset{\sim}{I}}_{n,y} = {{{- n}\;\Delta\; P_{n}\frac{1}{t_{e}}} + {\left( {n - 1} \right)\Delta\; P_{n}\frac{I_{f}}{t_{e}}} + {y\;\Delta\; P_{n}\frac{t_{r}}{t_{e}}} + {\Delta\; P_{n}\frac{t_{0}}{t_{e}}} + P_{n + 1}}$

being t₀ and d unknown. Image pixel values are given by I _(n)(x,y)=(1−t ₀ −yd)P _(n)(x,y)+(t ₀ +yd)P _(n)+1(x,y),

Same as before, P_(n)(x, y) and P_(n+1)(x, y) represent the pattern values contributing to camera pixel (x, y), we define P_(n+1)=P₁, P₀=P_(n), I_(n+1)=I₁, and I₀=I_(N), and I will omit pixel (x, y) to simplify the notation. We now minimize the following energy to find the time variables t₀ and d

${E\left( {t_{0},d} \right)} = {\frac{1}{2}{\sum\limits_{n = 1}^{N}{\sum\limits_{x,y}\left( {{\left( {1 - t_{0} - {yd}} \right)P_{n}} + {\left( {t_{0} + {yd}} \right)P_{n + 1}} - I_{n}} \right)^{2}}}}$

The partial derivatives are given by

$\frac{\partial{E\left( {t_{0},d} \right)}}{\partial t_{0}} = {\sum\limits_{n = 1}^{N}{\sum\limits_{x,y}{\left( {P_{n + 1} - P_{n}} \right)\left( {{\left( {1 - t_{0} - {yd}} \right)P_{n}} + {\left( {t_{0} + {yd}} \right)P_{n + 1}} - I_{n}} \right)}}}$ $\frac{\partial{E\left( {t_{0},d} \right)}}{\partial d} = {\sum\limits_{n = 1}^{N}{\sum\limits_{x,y}{{y\left( {P_{n + 1} - P_{n}} \right)}\left( {{\left( {1 - t_{0} - {yd}} \right)P_{n}} + {\left( {t_{0} + {yd}} \right)P_{n + 1}} - I_{n}} \right)}}}$

We set the gradient equal to the null vector and reorder as

$\begin{bmatrix} t_{0} \\ d \end{bmatrix} = {\left( {\sum\limits_{n,x,y}{\left( {P_{n + 1} - P_{n}} \right)^{2}\begin{bmatrix} 1 & y \\ y & y^{2} \end{bmatrix}}} \right)^{- 1}\left( {\sum\limits_{n,x,y}{\left( {P_{n + 1} - P_{n}} \right){\left( {I_{n} - {Pn}} \right)\begin{bmatrix} 1 \\ y \end{bmatrix}}}} \right)}$

We use Equation 29 to compute t₀ and d when we have some known (or estimated) pattern values.

With known t₀ and d we estimate pattern values minimizing

${E\left( {P_{1},\ldots\mspace{14mu},P_{N}} \right)} = {\frac{1}{2}{\sum\limits_{n = 1}^{N}{\left( {{\left( {1 - t_{0} - {yd}} \right)P_{n}} + {\left( {t_{0} + {yd}} \right)P_{n + 1}} - I_{n}} \right)^{2}.}}}$

Analogous as in Case 1 we obtain that Ap=b with A as in Equation 12 and α, β, and b defined as α=(1t ₀ −yd)²+(t ₀ +yd)²,β=(1−t ₀ −yd)(t ₀ +yd) b=(1−t ₀ −yd)(I ₁ I ₂ . . . ,I _(N))^(r)+(t ₀ +yd)(I _(N) ,I ₁ , . . . I _(N−1))^(r)

Pattern values for each pixel are given by p=A⁻¹ b.

In another preferred embodiment, the method to synthesize the synchronized sequence of image frames from an unsynchronized sequence of image frames, applies to a global shutter image sensor where the image frame rate is higher or equal than the pattern frame rate. FIG. 6 illustrates the timing for this embodiment. We now project M patterns at fixed framerate and we capture N images with a global shutter camera, also at a fixed framerate. We require that N≥M. Capture begins while pattern P₁ is being projected. We introduce a new variable d which is the camera capture delay from one row to the next. Same as in Case 1, up to two patterns may contribute to each image but here we do not know which ones are because the camera frame rate is unknown. The new image equation is

$I_{n} = {{\int_{t_{n - 1}}^{t_{n}}{\sum\limits_{m = 1}^{M}{{f_{m}(t)}P_{m}{dt}}}} = {\sum\limits_{m = 1}^{M}{P_{m}{\int_{t_{n - 1}}^{t_{n}}{{f_{m}(t)}{dt}}}}}}$ ${f_{m}(t)} = \left\{ \begin{matrix} 1 & {{{{if}\mspace{14mu} m} - 1} \leq t \leq m} \\ 0 & {otherwise} \end{matrix} \right.$

Let Δt=t_(n−1)−t_(n) the time between image frames, let p=(P₁ . . . , P_(M))^(T) and Φ_(n)(t₀, Δt)=(Φ_(n), 1, t₀, Δt), . . . , Φ(n, M, t₀, Δt))^(T) and rewrite Equation 33 as

$I_{n} = {\frac{1}{\Delta\; t}{\phi_{n}\left( {t_{0},{\Delta\; t}} \right)}^{T}p}$

Each function Φ(n, m, t₀, Δt)=∫_(n−1) ^(tn)f_(m)(t)dt can be written as Φ(n,m,t0,Δt)=max(0,min(m,t _(n))−max(m−1,t _(n−1)))

Same as before, P_(n)(x, y) represents a pattern value contributing to camera pixel (x, y), we define P_(n+1).=P₁, P₀=P_(N), I_(n+1)=I₁, and I₀=I_(n), and I will omit pixel (x, y) to simplify the notation.

We now minimize the following energy to find the time variables t₀ and Δt

${E\left( {t_{0},{\Delta\; t}} \right)} = {\frac{1}{2}{\sum\limits_{n = 1}^{N}{\sum\limits_{x,y}\left( {{\frac{1}{\Delta\; t}{\phi_{n}\left( {t_{0},{\Delta\; t}} \right)}^{T}p} - I_{n}} \right)^{2}}}}$

We solve for t₀ and Δt by making

∇E(t₀, Δ t) = 0 ${\nabla{E\left( {t_{0},{\Delta\; t}} \right)}} = {\sum\limits_{n = 1}^{N}{\sum\limits_{x,y}{\frac{1}{\Delta\; t}J\;{\phi_{n}\left( {t_{0},{\Delta\; t}} \right)}^{T}{p\left( {{\frac{1}{\Delta\; t}{\phi_{n}\left( {t_{0},{\Delta\; t}} \right)}^{T}p} - I_{n}} \right)}}}}$

Because JΦ_(n)(t₀, Δt) depends on the unknown value t=(t₀, Δt)^(T) we solve for them iteratively

t^((i − 1)) = A_(t)(t^((i)))⁻¹b_(t)(t^((i))) ${A_{t}(t)} = {\sum\limits_{n = 1}^{N}{\sum\limits_{x,y}{\frac{1}{\Delta\; t^{2}}J\;{\phi_{n}(t)}^{T}{pp}^{T}{V_{A}\left( {n,t} \right)}}}}$ ${b_{t}(t)} = {\sum\limits_{n = 1}^{N}{\sum\limits_{x,y}{\frac{1}{\Delta\; t}J\;{\phi_{n}(t)}^{T}{p\left( {I_{n} - {\frac{1}{\Delta\; t}{V_{b}\left( {n,t} \right)}^{T}p}} \right)}}}}$

Matrix V_(A)(n,t) and vector V_(b)(n,t) are defined such as

${\phi_{n}(t)} = {{{V_{A}\left( {n,t} \right)}\begin{bmatrix} t_{0} \\ {\Delta\; t} \end{bmatrix}} + {V_{b}\left( {n,t} \right)}}$

For completeness we include the following definitions:

  V_(A)(n, t) = [v_(A)(n, 1, t), …  , v_(A)(n, M, t)]^(T)   V_(b)(n, t) = [v_(b)(n, 1, t), …  , v_(b)(n, M, t)]^(T)   t_(diff) ≡ min (m, t_(n)) − max (m − 1, t_(n − 1)) ${v_{A}\left( {n,m,t} \right)} = \left\{ {{\begin{matrix} \left\lbrack {0,1} \right\rbrack^{T} & {{{{if}\mspace{14mu} m} - 1} \leq t_{n - 1} \leq t_{n} \leq {m\mspace{14mu}{and}\mspace{14mu} t_{diff}} > 0} \\ \left\lbrack {{- 1},{1 - n}} \right\rbrack^{T} & {{{{if}\mspace{14mu} m} - 1} \leq t_{n - 1} \leq m \leq {t_{n}\mspace{14mu}{and}\mspace{14mu} t_{diff}} > 0} \\ \left\lbrack {1,n} \right\rbrack^{T} & {{{if}\mspace{11mu} t_{n - 1}} \leq {m - 1} \leq t_{n} \leq {m\mspace{14mu}{and}\mspace{14mu} t_{diff}} > 0} \\ \left\lbrack {0,0} \right\rbrack^{T} & {{{if}\mspace{11mu} t_{n - 1}} \leq {m - 1} \leq m \leq {t_{n}\mspace{14mu}{and}\mspace{14mu} t_{diff}} > 0} \\ \left\lbrack {0,0} \right\rbrack^{T} & {otherwise} \end{matrix}\mspace{20mu}{v_{b}\left( {n,m,t} \right)}} = \left\{ {{\begin{matrix} 0 & {{{{if}\mspace{14mu} m} - 1} \leq t_{n - 1} \leq t_{n} \leq {m\mspace{14mu}{and}\mspace{14mu} t_{diff}} > 0} \\ m & {{{{if}\mspace{14mu} m} - 1} \leq t_{n - 1} \leq m \leq {t_{n}\mspace{14mu}{and}\mspace{14mu} t_{diff}} > 0} \\ {1 - m} & {{{if}\mspace{11mu} t_{n - 1}} \leq {m - 1} \leq t_{n} \leq {m\mspace{14mu}{and}\mspace{14mu} t_{diff}} > 0} \\ 1 & {{{if}\mspace{11mu} t_{n - 1}} \leq {m - 1} \leq m \leq {t_{n}\mspace{14mu}{and}\mspace{14mu} t_{diff}} > 0} \\ 0 & {otherwise} \end{matrix}\mspace{20mu} J\;{\phi_{n}(t)}} = {V_{A}\left( {n,t} \right)}} \right.} \right.$

With known t₀ and 66 t we estimate pattern values minimizing

${E(p)} = {\frac{1}{2}{\sum\limits_{n = 1}^{N}\left( {{{\phi_{n}(t)}^{T}p} - I_{n}} \right)^{2}}}$

Analogous as in Case 1 we obtain that Ap=b with

A = Φ^(T)Φ, b = Φ^(T)I $\Phi = \begin{bmatrix} {\phi_{1}(t)}^{T} \\ \vdots \\ {\phi_{N}(t)}^{T} \end{bmatrix}$

Pattern values for each pixel are given by p=A⁻¹b.

In another preferred embodiment, the method to synthesize the synchronized sequence of image frames from an unsynchronized sequence of image frames, applies to a rolling shutter image sensor where the image frame rate is higher or equal than the pattern frame rate. FIG. 7 illustrates the timing for this embodiment. Projector frame rate is 1, pattern P_(m) is projected between time m−1 and m. A camera frame is read every t_(f). A camera row requires t_(r) time to be readout from the sensor, thus, a sensor with Y rows needs a time Yt_(r) to read a complete frame, t_(r)≥Yt_(r). Each camera frame is exposed t.sub.e time, its readout begins immediately after exposure ends, t_(e)+t_(r)≥t_(f).

Camera row y in image n begins being exposed at time t_(n, y) t _(n,y) =t ₀+(n−1)t _(f) +yt _(y) ,y:0 . . . Y−1

and exposition ends at time t_(n,y)+t_(e).

In this model a pixel intensity in image n at row y is given by

I_(n, y) = ∫_(t_(n, y))^(t_(n, y) + t_(e))k_(n, y)P(t)dt + C_(n, y) $I_{n,y} = {{\sum\limits_{m = 1}^{M}{\max\left( {0,{\int_{\max{({t_{n,y},{m - 1}})}}^{\min{({{t_{n,y} + t_{c}},m})}}{k_{n,y}P_{m}{dt}}}} \right)}} + C_{n,y}}$

The constants k_(n, y) and C_(n, y) are scene dependent, P.sub.m is either 0 or 1.

Let be min{I.sub.n, y} a pixel being exposed while P(t)=0, and max{I.sub.n, y} a pixel being exposed while P(t)=1, min{I _(n,y) }=C _(n,y) max{I _(n,y) }=i _(e) k _(n,y) +C _(n,y)

Now, we define a normalized image.sub.n, yas,

${\overset{\sim}{I}}_{n,y} = \frac{I_{n,y} - {\min\left\{ I_{n,y} \right\}}}{\max\left\{ I_{n,y} \right\}\mspace{14mu}\min\left\{ I_{n,y} \right\}}$ ${\overset{\sim}{I}}_{n,y} = {\frac{1}{t_{e}}{\sum\limits_{m = 1}^{M}{\max\left( {0,{\int_{\max{({t_{n,y},{m - 1}})}}^{\min{({{t_{n,y} + t_{e}},m})}}{P_{m}{dt}}}} \right)}}}$

A normalized image is completely defined by the time variables and pattern values. In this section we want to estimate the time variables. Lets rewrite the previous equation as,

${\overset{\sim}{I}}_{n,y} = {\sum\limits_{m = 1}^{M}{{\phi\left( {n,m,y} \right)}P_{m}}}$ ${\phi\left( {n,m,y} \right)} = {\frac{1}{t_{e}}{\max\left( {0,{{\min\left( {{t_{n,y} + t_{e}},m} \right)} - {\max\left( {t_{n,y},{m - 1}} \right)}}} \right)}}$

Let be

${h = {\frac{1}{t_{e}}\left( {1,t_{f},t_{r},t_{0}} \right)^{T}}},$

-   -   now we write ϕ(n, m, y)=v_(nmy) ^(T)h with v_(nmy) defined as

$v_{nmy}^{T} = \left\{ {{{\begin{matrix} \left\lbrack {t_{e},0,0,0} \right\rbrack & {{{{if}\mspace{14mu} t_{n\; 2}} < t_{m\; 2}} ⩓ {t_{n\; 1} > t_{m\; 1}} ⩓ {t_{n\; 2} > t_{n\; 1}}} \\ \left\lbrack {{t_{e} - m + 1},{n - 1},y,1} \right\rbrack & {{{{if}\mspace{14mu} t_{n\; 2}} < t_{m\; 2}} ⩓ {t_{n\; 1} \leq t_{m\; 1}} ⩓ {t_{n\; 2} > t_{n\; 1}}} \\ \left\lbrack {m,{1 - n},{- y},{- 1}} \right\rbrack & {{{{if}\mspace{14mu} t_{n\; 2}} \geq t_{m\; 2}} ⩓ {t_{n\; 1} > t_{m\; 1}} ⩓ {t_{m\; 2} > t_{n\; 1}}} \\ \left\lbrack {1,0,0,0} \right\rbrack & {{{{if}\mspace{14mu} t_{n\; 2}} \geq t_{m\; 2}} ⩓ {t_{n\; 1} \leq t_{m\; 1}} ⩓ {t_{m\; 2} > t_{m\; 1}}} \\ \left\lbrack {0,0,0,0} \right\rbrack & {otherwise} \end{matrix}\mspace{20mu} t_{n\; 1}} = t_{n,y}},{t_{n\; 2} = {t_{n,y} + t_{e}}},{t_{m\; 1} = {m - 1}},{t_{m\; 2} = {{m\mspace{20mu}{Let}\mspace{14mu}{be}\mspace{14mu} p} = {{\left( {P_{1},\ldots\mspace{14mu},P_{M}} \right)^{T}\mspace{14mu}{and}\mspace{14mu}{let}\mspace{14mu} V_{ny}\mspace{14mu}{be}\mspace{20mu} V_{ny}} = {\begin{bmatrix}  - & v_{n\; 1y}^{T} & - \\ \; & \vdots & \; \\  - & v_{nMy}^{T} & -  \end{bmatrix}.}}}}} \right.$

We now minimize the following energy to find the unknown h

${E(h)} = {\frac{1}{2}{\sum\limits_{n = 1}^{N}{\sum\limits_{x,y}\left( {{{p\left( {x,y} \right)}^{T}V_{ny}h} - {{\overset{\sim}{I}}_{n}\left( {x,y} \right)}} \right)^{2}}}}$

with the following constraints

$h > {\begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix}\mspace{14mu}{{and}\mspace{14mu}\begin{bmatrix} 0 & {- 1} & \gamma & 0 \\ 0 & {- 1} & 1 & 0 \end{bmatrix}}h} \leq \begin{bmatrix} 0 \\ {- 1} \end{bmatrix}$

or equivalently

$\left. {{\frac{t_{r}}{e} - \frac{t_{f}}{t_{e}}} \leq {- 1}}\Rightarrow{{t_{r} + t_{e}} \leq t_{f}} \right.$

Equation E(h) cannot be minimized in closed form because the values matrix V_(n,y) depends on the unknown values. Using an iterative approach the current value h^((i)) is used to compute V_(n,y) ^((i)) and the next value h^((i+1)p1).

Up to this point we have assumed that the only unknown is h, meaning that pattern values are known for all image pixels. The difficulty lies is knowing which pattern pixel is being observed by each camera pixel. We simplify this issue by making calibration patterns all ‘black or all ‘white’, best seen in FIG. 8. For example, a sequence of four patterns ‘{black, black, white, white}’ will produce images with completely black and completely white pixels, as well as pixels in transition from black to white and vice versa. The all black or white pixels are required to produce normalized images, as shown in FIG. 9, and the pixels in transition constrain the solution of the parameter h in Equation E(h).

Decoding is done in two steps: 1) the time offset t₀ need to be estimated for this particular sequence; 2) the pattern values are estimated for each camera pixel, as shown in FIG. 10. Value t₀ is estimated using Equation E(h) where the known components of h are fixed, but some pattern values are required to be known, specially we need to know for some pixels whether they are transitioning from ‘black’ to ‘white’ or the opposite. Non-transitioning pixels provided no information in this step. Until now, we have projected a couple of black's and white's at the beginning of the sequence to ensure we can normalized all pixels correctly and to simplify t₀ estimation. We will revisit this point in the future for other pattern sequences.

Similarly as for the time variables, pattern values are estimated by minimizing the following energy

${{E(p)} = {\frac{1}{2}{\sum\limits_{n = 1}^{N}\left( {{h^{T}V_{ny}^{T}{p\left( {x,y} \right)}} - {{\overset{\sim}{I}}_{n}\left( {x,y} \right)}} \right)^{2}}}},{{s.t.\mspace{14mu}{p_{m}}} \leq 1}$

The matrix h^(T) V_(n,y) ^(T) is bi-diagonal for N=M and it is fixed if h is known.

Therefore, it can be seen that the exemplary embodiments of the method and system provides a unique solution to the problem of using structure lighting for three-dimensional image capture where the camera and projector are unsychronized.

It would be appreciated by those skilled in the art that various changes and modifications can be made to the illustrated embodiments without departing from the spirit of the present invention. All such modifications and changes are intended to be within the scope of the present invention except as limited by the scope of the appended claims. 

What is claimed is:
 1. The system to capture the surface geometry of a three dimensional object in a scene comprising a pattern projector, a camera, and a computing processor; the pattern projector configured and arranged to project a sequence of image patterns onto the scene at a pattern frame rate; the pattern frame rate measured in image patterns per second; the sequence of image patterns containing a number of image patterns; the number of image patterns being equal to the length of the sequence of image patterns; the camera having an image sensor; the camera configured and arranged to capture a sequence of unsynchronized image frames of the scene at an image capture rate; the image capture rate measured in frames per second; the image capture rate being larger or equal than the pattern frame rate; the sequence of unsynchronized image frame containing a number of unsynchronized image frames; the number of unsynchronized image frames being equal to the length of the sequence of unsynchronized image frames; the number of unsynchronized image frames captured by the camera being larger or equal than the number of image patterns; the sequence of image patterns having a first image pattern, a plurality of intermediate image patterns, and a last image pattern; the sequence of unsynchronized image frames having a first unsynchronized image frame, a plurality of intermediate unsynchronized image frames, and a last unsynchronized image frame; the projector starting projecting the first image pattern at a first start projection time; the projector ending projecting the first image pattern at a first stop projection time; the camera starting capturing the first unsynchronized image frame at a first start capture time; the first start capture time being not earlier than the first start projection time; the first start capture time being not later than at the first stop projection time; the projector starting projecting the last image pattern at a last start projection time; the projector ending projecting the last image pattern at a last stop projection time; the camera ending capturing the last unsynchronized image frame at a last stop capture time; the last stop capture time being larger or equal than last start projection time; the last stop capture time being less or equal than last stop projection time; the computing processor configured and arranged to execute a process to synthesize a sequence of synchronized image frames from the sequence of unsynchronized image frames; the unsynchronized image frames and the unsynchronized images frames being digital images of the same dimensions, and sharing a plurality of common image pixels; each unsynchronized image frame having an unsynchronized pixel value corresponding to each common image pixel; each synchronized image frame having a synchronized pixel value corresponding to each common image pixel; the sequence of synchronized image frame containing a number of synchronized image frames; the number of synchronized image frames being equal to the length of the sequence of synchronized image frames; the number of synchronized image frames being equal to the number of image patterns; and each of the synchronized image frames corresponding to one image pattern in the sequence of image patterns.
 2. The system, as in claim 1, where the camera and the computing processor are components of a single device such a digital camera, smartphone, or computer tablet.
 3. The system as in claim 1, further comprising processes for decoding, three dimensional triangulation, and optionally geometric processing, executed by the computing processor.
 4. The system as in claim 1, where the projector can select the pattern rate from a plurality of supported pattern rates, the camera can select the frame rate from a plurality of supported frame rates, and the camera can capture the unsynchronized image frames in burst mode at a fast frame rate.
 5. The system as in claim 4, where the projector has a knob to select the pattern rate.
 6. The system as in claim 4, where the pattern rate is set by a pattern rate code sent to the projector through a communications link.
 7. The system as in claim 4, wherein the pattern rate and the frame rate are set so that the frame rate is not slower than the pattern rate.
 8. The system as in claim 4, wherein a user sets the pattern rate and the frame rate.
 9. The system as in claim 4, where the camera can receive a camera trigger signal, and set the number of burst mode frames.
 10. The system as in claim 9, where the camera trigger signal is generated by a camera trigger push-button, and the camera starts capturing the unsynchronized image frames at the set frame rate as soon as it receives the trigger signal, and it stops capturing unsynchronized image frames after capturing the set number of burst mode frames.
 11. The system as in claim 9, where the projector continuously projects the sequence of patterns in a cyclic fashion.
 12. The system as in claim 11, wherein the process can detect when the first pattern is about to be projected, and the camera trigger signal is delayed until that moment.
 13. The system as in claim 9, where the projector can receive a projector trigger signal.
 14. The system as in claim 13, where the camera can send the projector trigger signal to the projector.
 15. The system as in claim 14, where the camera has a flash trigger output, and it sends the projector trigger signal to the projector through the flash trigger output, the projector starts projecting the sequence of patterns at the set pattern rate when it receives the trigger signal, and the projector stops projecting patterns after it projects the last pattern.
 16. The system as in claim 1, where the camera image sensor is a global shutter image sensor, the image capture rate is equal to the pattern frame rate, the number of image patterns in the sequence of image patterns is equal to the number of unsynchronized image frames in the sequence of unsynchronized image frames, a method to synthesize the sequence of synchronized image frames from the sequence of unsynchronized image frames comprises the following steps: a determining a plurality of active pixels; the plurality of active pixels being a subset of the plurality of common pixels; each active pixel in the plurality of active pixels corresponding to a three dimensional point in the scene illuminated by the image patterns projected by projector; b determining a plurality of active pixels with known synchronized values; the plurality of active pixels with known synchronized values being a subset of the plurality of active pixels; c estimating a normalized start time for the first unsynchronized image frame as a function of the plurality of active pixels with known synchronized values, and the unsynchronized image frames; the normalized start time being the difference between the first start capture time and the first start projection time, divided by the image capture frame time; the image capture frame time being the inverse of the image capture rate; d selecting an active pixel; e estimating the synchronized pixel values of the synchronized image frames corresponding to the active pixel; and f repeating steps d) and e) until all active pixels have been selected.
 17. The system as in claim 16, where the step of estimating the normalized start time for the first unsynchronized image frame is performed by minimizing the following expression with respect to the normalized start time $\frac{1}{2}{\sum\limits_{n = 1}^{N}{\sum\limits_{({x,y})}\left( {{\left( {1 - t_{0}} \right){P_{n}\left( {x,y} \right)}} + {t_{0}{P_{n + 1}\left( {x,y} \right)}} - {I_{n}\left( {x,y} \right)}} \right)^{2}}}$ where t₀ is the normalized start time, N is the number of image patterns, n is a pattern index, (x, y is one of the active pixels, the second sum is over the active pixels, P_(n)(x, y) is the synchronized pixel value of the n-th. synchronized image frame corresponding to the active pixel (x, y, Pn+₁(x, y) is the synchronized pixel value of the (n+1)-th. synchronized image frame corresponding to the active pixel (x, y, P_(N)+₁(x, y) P₁(x, y), and I_(n)(x, y) is the pixel value of the n-th. unsynchronized image frame corresponding to the active pixel (x, y).
 18. The system as in claim 16, where the step of estimating the synchronized pixel values of the synchronized image frames corresponding to the active pixel is performed by solving the following N×N system of linear equations with respect to the synchronized pixel values of the synchronized image frames corresponding to the active pixel βP _(n−1)(x,y)+αP _(n)(x,y)+βP _(n+1)(x,y)=t ₀ I _(n−1)(x,y)+(1−t ₀)I _(n)(x,y) n=1, . . . ,N where t₀ is the normalized start time, N is the number of image patterns, n is a pattern index, (x, y is the active pixel, α=t₀ ²(1−t₀)², β=t₀(1−t₀), P₁(x,y), . . . , P_(N)(x,y)i are the synchronized pixel values of the synchronized image frames corresponding to the active pixel (x, y being estimated, P⁻¹(x,y)=P_(N)(x,y), P_(N+1)(x,y)=P₁(x,y), I₁(x,y), . . . , I_(N)(x,y) are the pixel values of the unsynchronized image frames corresponding to the active pixel (x, y, I⁻¹(x,y)=I_(N)(x,y). 